package cn.starfire.sttool.tools;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Stage;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Arrays;
import java.util.List;

/**
 * @description:
 * @author: tanpengji
 * @time: 2025/8/27 10:00
 */
public class ToolsMainApp  extends Application {

    @Override
    public void start(Stage stage) {
        stage.setTitle("Starfire 工具箱");

        // 注册所有工具
        List<ToolModule> tools = Arrays.asList(
                new JsonToExcelTool(),
                new PasswordGeneratorTool()
        );

        TabPane tabPane = new TabPane();
        for (ToolModule tool : tools) {
            Tab tab = new Tab(tool.getName(), tool.getContent());
            tab.setClosable(false);
            tabPane.getTabs().add(tab);
        }

        stage.setScene(new Scene(tabPane, 600, 400));
        stage.show();
    }

}
